package com.dbms.controller;

import com.dbms.common.annotation.ResponseResult;
import com.dbms.domain.dto.BisXajmodeParasDTO;
import com.dbms.domain.vo.BisXajmodeParasVO;
import com.dbms.service.BisXajmodeParasService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Tag(name = "模型参数管理", description = "模型参数管理相关接口")
@RestController
@RequestMapping("/bis_xaj_mode_paras")
@RequiredArgsConstructor
public class BisXajmodeParasController {

    final BisXajmodeParasService bisXajmodeParasService;

    @Operation(summary = "根据控制面编码获取模型参数数据", description = "根据控制面编码获取模型参数数据")
    @GetMapping("/getInfoByStationCode")
    public ResponseResult<BisXajmodeParasVO> getInfoByStationCode(@RequestParam("stationCode") String stationCode){
        return ResponseResult.success(bisXajmodeParasService.getInfoByStationCode(stationCode));
    }


    @Operation(summary = "添加或修改模型参数", description = "添加或修改模型参数")
    @PostMapping("/saveOrUpdate")
    public ResponseResult<Boolean> saveOrUpdate(@Parameter(description = "模型参数信息") @RequestBody BisXajmodeParasDTO dto){
        return ResponseResult.success(bisXajmodeParasService.saveOrUpdate(dto));
    }
}
